package com.hsmpay

import com.hsmpay.utils.Des3

/**
 * Created by weng on 16/4/14.
 */

fun main(args: Array<String>) {
    val transferKey = "22222222222222220123456789ABCDEF"
    val encryptedMasterKey = "7FB93777737F8AB47F2BD7F30F68A964"
    val masterKey = Des3.decode3DES(encryptedMasterKey, transferKey)
    val workKey = "5936E0ACADD95F6517D5FE47923AB5F9"
    val verifyValue = "1902148B"
    val decryptedWorkKey = Des3.decode3DES(workKey, masterKey)
    println("主密钥明文: " + masterKey)
    println("主密钥校验值: " + "80CD9FBB   " + Des3.encode3DES("00000000000000000000000000000000", masterKey))
    println(verifyValue)
    println(Des3.encode3DES("00000000000000000000000000000000", decryptedWorkKey))
}
